Right in the middle of conversion, not compilable yet

This commit is contained in:
2021-01-27 00:59:36 +00:00
parent f2563c87fa
commit 882adf63a0
4 changed files with 45 additions and 21 deletions

View File

@@ -89,25 +89,54 @@ todo: DataList view and filter are combined and this is wrong
{
offset: 0,
limit: 10,
dataListKey: "PartInventoryTransactionsDataList",
dataListKey: "PartInventoryTransactionsDataList",
columns:["PartInventoryTransactionEntryDate","PartPartNumber","PartWarehouseName","PartInventoryTransactionQuantity","PartInventoryTransactionDescription","PartInventoryTransactionSource","PartInventoryBalance"]
sortBy:["PartInventoryTransactionEntryDate"],//same as grid natively does all columns here
sortDesc:[true]//same as grid natively does, all columns here true or false each
filter:[{column:"PartPartNumber",items:[{op: "=",value: "400735"}]}]
sortBy:["PartInventoryTransactionEntryDate-"],//All sorted columns here appends + for ascending - for descending to field name
filter:[{column:"PartPartNumber",items:[{op: "=",value: "400735"}]}],
clientCriteria:"2" //could be anything here that makes sense to the list, in this case an example customer id for customernotedatalist
}
# METAVIEW / VARIANT
# METAVIEW / VARIANT / PROGRAMMATIC FILTERING
There are filters users make and filters the program makes
Some filters are STATIC and always applied regardless for security or other reasons and those should be done entirely at teh server
(IAyaDataListServerCriteria)
Memo, Reminders so only can see their own, Reviews filter by role to see more potentially
Some filters are DYNAMIC and restrict by columns that the user can control so they replace user filters adn appear as same as user filter
user can remove it to see all or adjust it or whatever
Some filters are MIXED / INVISIBLE as they require data provided by client but user doesn't see them or control them
CustomerNoteDataList
potentially more in future so needs support, is ideally solved by metafilter now but if that is being removed need alternative
CURRENT METAVIEW DATALIST FILTERS IN USE
InsideUserDataList (adm-users) STATIC (could use IAyaDataListServerCriteria)
MemoDataList STATIC current TO user only uses IAyaDataListServerCriteria already
ServiceBankDataList DYNAMIC
OutsideUserDataList (cust-users) STATIC could use IAyaDataListServerCriteria
ReviewDataList (home-reviews) DYNAMIC (both single and multiple)
PartInventoryTransactionsDataList (inv-part-inventory-transactions) DYNAMIC
PartInventoryDataList (inv-part-inventory) DYNAMIC
* CustomerNoteDataList (cust-customer-notes) MIXED STATIC but with DYNAMIC value currently using metaview but is actually static, however current server IAyaDataListServerCriteria can't accept a customer id so...
NOTES: Metaview is used for two different thigns currently:
STATICALLY restricting a list to an always required filter like adm-users and cust-users and cust-customer-notes
solution is use variant system like picklist
DYNAMICALLY restricting a list to an on the fly filter like ShowAll
solution is solved by above changes and can provide alterantive filter programmatically any time
MIXED restricting a list on teh fly but also support user filtering
todo: remove metaview entirely at both ends
todo: Modify DataList and implement Variant system just like picklists already does
must work with same capabilities shown in the current UnitPickList GetVariantCriteria which will work for the current STATICALLY filtered lists
(any list where the metaview was static and not optional but required for the view to work)
todo: replace STATIC FILTERS with existing IAyaDataListServerCriteria interface and filter
todo: replace DYNAMIC FILTERS with system above
todo: replace MIXED VARIANT FILTERS with variant system
SEEDER
@@ -121,7 +150,8 @@ todo: DataList - there are a bunch of props being set that don't exist, for exam
remove them with impunity
todo: userbiz validate can delete has funky error
todo: bugbug filter on a phone number field results in error at server as unsupported type
make sure all types are supported
todo: *biz objects with foreign key constraints should call ValidateCanDelete
and validatecandelete *MUST* check for those constraints and return a proper error object
Note: this must happen independently for EACH reference so check each referencing table one by one and add an error for each to send back to user

View File

@@ -42,7 +42,7 @@ export default {
);
if (vm.objectId && vm.objectId != 0 && vm.objectType) {
//pre-filter
//DYNAMIC FILTER
vm.metaView = JSON.stringify([
{
fld: "metaservicebankobjectid",

View File

@@ -27,7 +27,7 @@
const FORM_KEY = "adm-users";
export default {
created() {
//Inside users only
//STATIC FILTER Inside users only
this.metaView = JSON.stringify([
{
fld: "usertype",

View File

@@ -16,7 +16,7 @@
:dataListSort="dataListSort"
:showSelect="rights.read"
:reload="reload"
:metaView="metaView"
:clientCriteria="clientCriteria"
v-on:selection-change="handleSelected"
data-cy="customerNotesTable"
>
@@ -31,18 +31,12 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////
const FORM_KEY = "cust-customer-notes";
//"[{\"fld\":\"widgetname\",\"filter\":{\"items\":[{\"op\":\"%-\",\"value\":\"Awesome\"}]}},{\"fld\":\"widgetserial\"},{\"fld\":\"widgetdollaramount\"},{\"fld\":\"widgetusertype\",\"filter\":{\"items\":[{\"op\":\"=\",\"value\":1}]}},{\"fld\":\"widgetstartdate\"},{\"fld\":\"widgetactive\"},{\"fld\":\"username\",\"filter\":{\"items\":[{\"op\":\"=\",\"value\":\"aya\"}]}},{\"fld\":\"widgettags\"},{\"fld\":\"widgetcustom1\"},{\"fld\":\"widgetcustom2\"}]"
export default {
created() {
this.customername = this.$route.params.customername;
this.customerId = parseInt(this.$route.params.customerid);
this.metaView = JSON.stringify([
{
fld: "metacustomer",
filter: { items: [{ op: "=", value: this.customerId }] }
}
]);
//MIXED STATIC But with provided criteria FILTER
this.clientCriteria = this.customerId.toString();
this.rights = window.$gz.role.getRights(window.$gz.type.CustomerNote);
window.$gz.eventBus.$on("menu-click", clickHandler);
generateMenu(this);
@@ -58,7 +52,7 @@ export default {
dataListKey: "CustomerNoteDataList",
dataListFilter: "",
dataListSort: "",
metaView: undefined,
clientCriteria: undefined,
rights: window.$gz.role.defaultRightsObject(),
ayType: window.$gz.type.CustomerNote,
selectedItems: [],