This commit is contained in:
2020-03-20 00:04:03 +00:00
parent 5a48c5bbb3
commit cbf0952ffc

View File

@@ -40,15 +40,28 @@
//NOTE: have to import lodash directly here as no combination was working with the window.$gz._
//it would not recognize window in the function call
import _ from "../libs/lodash.min.js";
//todo: custom filter (highlight in results) that works with tags (ignore tag part and filter as normal)
//todo: validation error is obscured by no-data element
//todo: set actual seleted ID value from our local selected whole object so outer form just gets id
//todo test multiple selection
//todo: search only property that forces user to search vs just drop down and get default 100
//todo: append or use slot to put at end of drop down menu a "type to search for more" when the results are from an empty query only
//todo: translation keys when done
/*
todo: validation error is obscured by no-data element
- PREPEND SLOT - use the prepend slot to add custom error message box or mirror it, In addition to the help link mentioned below or maybe this is it?
- style it to look like the error slot
- maybe on validation error it should just clear the list so this will reveal the error?
- can't get this to do anything, it's very stubborn
- maybe on validation error it shows elsewhere (popup error dialog with help link?) or just goes red and a HELP icon appears to take to how to use picklist?
- also there is suffix and prefix text options to explore
- also there is separately HINT and PLACEHOLDER text, maybe HINT is what I'm after here
- NOPE: hint is useless, it just gets obscured by drop down items list just like error and is replaced by error message
todo: set actual seleted ID value from our local selected whole object so outer form just gets id
todo test multiple selection
todo: search only property that forces user to search vs just drop down and get default 100
todo: append or use slot to put at end of drop down menu a "type to search for more" when the results are from an empty query only
todo: translation keys when done
todo: option to display icon to open the record selected, (we have the type and the id and in v7 you could click on most titles to navigate to that record)
if I add that then maybe need a "new" option on edit forms because it's a two step way to get to adding a new one of whatever it is without having to go
completely out of the page and hunt around lists and shit!!!
or consider a direct NEW button right there, (this might be a winner)
or maybe combine the two ideas, if no selection or empty selection then the button acts as new, puts any entered search text into the Name field
or, if selection then it acts as open
*/
export default {
created() {
//need to add no selection object if specified
@@ -144,9 +157,10 @@ export default {
return window.$gz.translation.get(ltkey);
},
customFilter(item, queryText, itemText) {
//NOTE: I wanted this to work but all it does is highlight all of each row if tag query is present
//NOTE: I wanted this to work with tags but all it does is highlight all of each row if tag query is present
//I guess because it later on attempts to do the highlighting and can't find all the entered query
//it's not clean so I'm just going to make it only highlight if it's a non tag query for now
//and do no filtering (highlighting) at all if it's a tag query
if (queryText.includes(" ") || queryText.startsWith("..")) {
this.isTagFilter = true;
return false;
@@ -217,6 +231,7 @@ export default {
if (queryTerms.length > 2) {
//todo: put client side localized validation error message in component
vm.errors.push("LTERROR TOO MANY TERMS");
return;
}
isATwoTermQuery = true;
@@ -255,6 +270,7 @@ export default {
vm.errors.push(
"LTERROR if two terms one must be tag and one must be text"
);
return;
}
@@ -267,6 +283,7 @@ export default {
vm.errors.push(
"LTERROR if two terms one must be tag and one must be text"
);
return;
}
}